package mx.vlabs.soapdroid;

import java.net.URL;

import javax.xml.namespace.QName;

public class Service {
	
	public enum Mode { MESSAGE, PAYLOAD }
	
	protected Service(URL wsdlDocumentLocation, QName serviceName) {
        delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation, serviceName, getClass());
    }
	
	/*
    protected Service(URL wsdlDocumentLocation, QName serviceName, WebServiceFeature... features) {
        delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation, serviceName, getClass(), features);
    }
    */
	
	public <T> T getPort(QName portName, Class<T> serviceEndpointInterface) {
        return (T) delegate.getPort(portName, serviceEndpointInterface);
    }

    public <T> T getPort(Class<T> serviceEndpointInterface) {
        return (T) delegate.getPort(serviceEndpointInterface);
    }
	  
    
    private ServiceDelegate delegate;

}
